package cn.ezios.huo.common.mvc;

import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class Ret {

    private String code;

    private Object data;

    public static Ret ok(Object data) {
        return new Ret().setCode("0").setData(data);
    }
    public static Ret ok(String data) {
        return new Ret().setCode("0").setData(data);
    }
    public static Ret ok() {
        return new Ret().setCode("0");
    }

    public static Ret error(String msg) {
        return new Ret().setCode("-1").setData(msg);
    }

    public static Ret error() {
        return new Ret().setCode("-1").setData("操作失败");
    }

}
